package pc15;

import java.util.Scanner;

public class J09Retangle {

	public static void main(String[] args) {

		//변수선언
		final int num = 2;
		double width[] = new double[num],height[] = new double[num];
		String color[] = new String[num];
		String result="";
		double area[] = new double[num], perimeter[] = new double[num];
		
		inputRetangel(width, height, color);
		getArea(area, width, height);
		getPerimeter(perimeter, width, height);
		
		result += "-----------결과 출력 ------------\n";
		result += "사각형의 색상: "+color[1]+", 가로: "+width[1]+", 세로: "+height[1]
				+ "\n사각형의 둘레: "+perimeter[1]+", 면적: "+area[1];
		
		//출력
		System.out.println(result);
	
	}//main
	
	//가로, 세로 길이 입력
	public static void inputRetangel(double[] width, double[] height, String[] color){
		Scanner sc = new Scanner(System.in);
		System.out.print("가로 길이:"); width[1] = sc.nextInt();
		System.out.print("세로 길이:"); height[1] = sc.nextInt();
		System.out.print("색상:"); color[1] = sc.next();
		
		sc.close();
	}
	//면적 계산
	public static void getArea(double[] area,double[] width, double[] height){
		area[1] = width[1] * height[1];
	}
	//둘레 계산
	public static void getPerimeter(double[] perimeter, double[] width, double[] height){
		perimeter[1] = 2 * (width[1] + height[1]);
	}
	
}//class
